package com.smartcode.ai.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smartcode.ai.entity.po.KnowledgePoint;
import com.smartcode.ai.mapper.KnowledgePointMapper;
import com.smartcode.ai.service.IKnowledgePointService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KnowledgePointServiceImpl extends ServiceImpl<KnowledgePointMapper, KnowledgePoint> implements IKnowledgePointService {

    @Override
    public List<KnowledgePoint> listByCourseId(Integer courseId) {
        return lambdaQuery().eq(KnowledgePoint::getCourseId, courseId)
                           .orderByAsc(KnowledgePoint::getSortOrder)
                           .list();
    }
}